#pragma once
#include"AABB.h"
#include "Hittable.h"

#include <vector>

class CHittableList : public CHittable {
public:
	std::vector<shared_ptr<CHittable>> m_Objects;

	CHittableList() {};
	CHittableList(shared_ptr<CHittable> vObject) { addObjects(vObject); }

	void addObjects(shared_ptr<CHittable> vObject);
	bool hit(const CRay& vR, CInterval vRayT, CHitRecord& vHitRecord) const override;

	CAABB boundingBox()const override { return m_BBox; }

private:
	CAABB m_BBox;
};